import { Navigate } from "react-router-dom";

import Index from "@/views/Index/Index";
import Login from "@/views/Login/Login";
import NotFound from "@/views/NotFound/NotFound";

import Home from "@/views/Index/Home/Home";
import Swiper from "@/views/Index/Swiper/Swiper";
import AddSwiper from "@/views/Index/SwiperAdd/SwiperAdd";
import Users from "@/views/Index/Users/Users";
import Products from "@/views/Index/Products/Products";
import Seckill from "@/views/Index/Seckill/Seckill";
import Recommend from "@/views/Index/Recommend/Recommend";
import Screen from "@/views/Index/Screen/Screen";
import Echarts from "@/views/Index/Echarts/Echarts";
import Editors from "@/views/Index/Editors/Editors";
import In from "@/views/Index/In/In";
import Out from "@/views/Index/Out/Out";
import Maps from "@/views/Index/Maps/Maps";


export default [
    {
        path:'/index',
        element:<Index />,
        children:[
            {
                path:'/index/home',
                element:<Home />,
            },
            {
                path:'/index/swiper',
                element:<Swiper />,
            },
            {
                path:'/index/swiper_add',
                element:<AddSwiper />,
            },
            {
                path:'/index/users',
                element:<Users />,
            },
            {
                path:'/index/products',
                element:<Products />,
            },
            {
                path:'/index/seckill',
                element:<Seckill />,
            },
            {
                path:'/index/recommend',
                element:<Recommend />,
            },
            {
                path:'/index/screen',
                element:<Screen />,
            },
            {
                path:'/index/echarts',
                element:<Echarts />,
            },
            {
                path:'/index/editors',
                element:<Editors />,
            },
            {
                path:'/index/in',
                element:<In />,
            },
            {
                path:'/index/out',
                element:<Out />,
            },
            {
                path:'/index/maps',
                element:<Maps />,
            },
            {
                path:'/index',
                element:<Navigate to='/index/home' />,
            },
            {
                path:'*',
                element:<NotFound />,
            },
        ]
    },    
    {
        path:'/login',
        element:<Login />,
    },
    {
        path:'/',
        element:<Navigate to='/index' />,
    },
    {
        path:'*',
        element:<NotFound />,
    },
]